package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1
import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.mfin.enumeration.AccountCategory;
import com.mfin.enumeration.AccountHead;
import com.mfin.enumeration.TransactionMode;
import com.mfin.enumeration.TransactionType;

/**
 * Cashbook generated by hbm2java
 */
@Entity
@Table(name = "cashbook", catalog = "mfindb")
public class Cashbook implements java.io.Serializable {

	private Long id;
	private User user;
	private Customer customer;
	private FinanceLoan financeLoan;
	private FinanceChit financeChit;
	private Finance finance;
	private Partner partner;
	private Date date;
	private AccountCategory accountCategory;
	private AccountHead accountHead;
	private Double credit;
	private Double debit;
	private String personName;
	private String bankName;
	private TransactionMode transactionMode;
	private String chequeNumber;
	private TransactionType transactionType;
	private String purpose;
	private String towards;
	private String remarks;

	public Cashbook() {
	}

	public Cashbook(User user, Customer customer, FinanceLoan financeLoan,
			FinanceChit financeChit, Finance finance, Partner partner, Date date,
			AccountCategory accountCategory, AccountHead accountHead, Double credit,
			Double debit, String personName, String bankName,
			TransactionMode transactionMode, String chequeNumber,
			TransactionType transactionType, String purpose, String towards,
			String remarks) {
		this.user = user;
		this.customer = customer;
		this.financeLoan = financeLoan;
		this.financeChit = financeChit;
		this.finance = finance;
		this.partner = partner;
		this.date = date;
		this.accountCategory = accountCategory;
		this.accountHead = accountHead;
		this.credit = credit;
		this.debit = debit;
		this.personName = personName;
		this.bankName = bankName;
		this.transactionMode = transactionMode;
		this.chequeNumber = chequeNumber;
		this.transactionType = transactionType;
		this.purpose = purpose;
		this.towards = towards;
		this.remarks = remarks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMER_ID")
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FINANCE_LOAN_ID")
	public FinanceLoan getFinanceLoan() {
		return this.financeLoan;
	}

	public void setFinanceLoan(FinanceLoan financeLoan) {
		this.financeLoan = financeLoan;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "CHIT_MBR_SNO", referencedColumnName = "SNO"),
			@JoinColumn(name = "CHIT_ID", referencedColumnName = "CHIT_ID") })
	public FinanceChit getFinanceChit() {
		return this.financeChit;
	}

	public void setFinanceChit(FinanceChit financeChit) {
		this.financeChit = financeChit;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FINANCE_ID")
	public Finance getFinance() {
		return this.finance;
	}

	public void setFinance(Finance finance) {
		this.finance = finance;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTNER_ID")
	public Partner getPartner() {
		return this.partner;
	}

	public void setPartner(Partner partner) {
		this.partner = partner;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATE", length = 19)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "ACCOUNT_CATEGORY", length = 50)
	@Enumerated(EnumType.STRING)
	public AccountCategory getAccountCategory() {
		return this.accountCategory;
	}

	public void setAccountCategory(AccountCategory accountCategory) {
		this.accountCategory = accountCategory;
	}

	@Column(name = "Account_Head", length = 50)
	@Enumerated(EnumType.STRING)
	public AccountHead getAccountHead() {
		return this.accountHead;
	}

	public void setAccountHead(AccountHead accountHead) {
		this.accountHead = accountHead;
	}

	@Column(name = "CREDIT", precision = 22, scale = 0)
	public Double getCredit() {
		return this.credit;
	}

	public void setCredit(Double credit) {
		this.credit = credit;
	}

	@Column(name = "DEBIT", precision = 22, scale = 0)
	public Double getDebit() {
		return this.debit;
	}

	public void setDebit(Double debit) {
		this.debit = debit;
	}

	@Column(name = "PERSON_NAME", length = 50)
	public String getPersonName() {
		return this.personName;
	}

	public void setPersonName(String personName) {
		this.personName = personName;
	}

	@Column(name = "BANK_NAME", length = 50)
	public String getBankName() {
		return this.bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	@Column(name = "TRANSACTION_MODE", length = 7)
	@Enumerated(EnumType.STRING)
	public TransactionMode getTransactionMode() {
		return this.transactionMode;
	}

	public void setTransactionMode(TransactionMode transactionMode) {
		this.transactionMode = transactionMode;
	}

	@Column(name = "CHEQUE_NUMBER", length = 23)
	public String getChequeNumber() {
		return this.chequeNumber;
	}

	public void setChequeNumber(String chequeNumber) {
		this.chequeNumber = chequeNumber;
	}

	@Column(name = "TRANSACTION_TYPE", length = 50)
	@Enumerated(EnumType.STRING)
	public TransactionType getTransactionType() {
		return this.transactionType;
	}

	public void setTransactionType(TransactionType transactionType) {
		this.transactionType = transactionType;
	}

	@Column(name = "PURPOSE", length = 100)
	public String getPurpose() {
		return this.purpose;
	}

	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}

	@Column(name = "TOWARDS", length = 50)
	public String getTowards() {
		return this.towards;
	}

	public void setTowards(String towards) {
		this.towards = towards;
	}

	@Column(name = "REMARKS", length = 50)
	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

}
